package com.group.eams.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group.eams.pojo.dto.SoftwareQueryDto;
import com.group.eams.pojo.entity.Software;
import com.group.eams.pojo.vo.SoftwareAccountVo;
import com.group.eams.pojo.vo.SoftwareAuthorizationVo;
import com.group.eams.pojo.vo.SoftwareListVo;
import com.group.eams.service.SoftwareService;
import com.group.eams.mapper.SoftwareMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
* @author 恩哲欣
* @description 针对表【software(无形资产(软件)表)】的数据库操作Service实现
* @createDate 2024-10-29 16:09:34
*/
@Service
public class SoftwareServiceImpl extends ServiceImpl<SoftwareMapper, Software> implements SoftwareService{

    @Autowired
    private SoftwareMapper softwareMapper;
    /**
     * 分页查询
     *
     * @param softwareQueryDto
     * @return
     */
    @Override
    public Page<SoftwareListVo> findByQueryDto(SoftwareQueryDto softwareQueryDto) {
        Page<SoftwareListVo> page = new Page<>(softwareQueryDto.getPage(), softwareQueryDto.getLimit());
        return softwareMapper.findByQueryDto(page,softwareQueryDto);
    }

    /**
     * 根据id查询授权信息
     *
     * @param id
     * @return
     */
    @Override
    public SoftwareAuthorizationVo findAuthorizationById(Long id) {
        return softwareMapper.findAuthorizationById(id);
    }

    /**
     * 根据id查询财务信息
     *
     * @param id
     * @return
     */
    @Override
    public SoftwareAccountVo findAccountById(Long id) {
        return softwareMapper.findAccountById(id);
    }

    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    @Override
    public Software findById(Long id) {
        return softwareMapper.findById(id);
    }

    /**
     * 查询所有
     *
     * @return
     */
    @Override
    public List<Software> findAll() {
        return softwareMapper.findAll();
    }

    /**
     * 根据id查询基础信息
     *
     * @param id
     * @return
     */
    @Override
    public SoftwareListVo findBasicById(Long id) {
        return softwareMapper.findBasicById(id);
    }
}
